#include<iostream>
using namespace std;
int main(){
  bool flag=1;
  int arr[5][5]={};
  int i,j,k;
  for(i=0;i<5;i++){
    for(j=0;j<5;j++)cin>>arr[i][j];
  }
  int m,n;
  for(i=0;i<5;i++){
    n=0;
    for(j=1;j<5;j++){
      if (arr[i][j]>arr[i][n]) 
        n=j;
    }
    m=0;
    for(k=1;k<5;k++){
      if(arr[m][n]>arr[k][n])
        m=k;
    }
    if(i==m){
      flag=0;
      cout<<m+1<<" "<<n+1<<" "<<arr[m][n]<<endl;
    }
  }
  if(flag)cout<<"not found";
}